<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.Pipes_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
    <Compile Include="Microsoft\Win32\SafeHandles\SafePipeHandle.cs" />
    <Compile Include="System\IO\Error.cs" />
    <Compile Include="System\IO\Pipes\AnonymousPipeClientStream.cs" />
    <Compile Include="System\IO\Pipes\AnonymousPipeServerStream.cs" />
    <Compile Include="System\IO\Pipes\NamedPipeClientStream.cs" />
    <Compile Include="System\IO\Pipes\NamedPipeServerStream.cs" />
    <Compile Include="System\IO\Pipes\PipeAccessRights.cs" />
    <Compile Include="System\IO\Pipes\PipeDirection.cs" />
    <Compile Include="System\IO\Pipes\PipeOptions.cs" />
    <Compile Include="System\IO\Pipes\PipeState.cs" />
    <Compile Include="System\IO\Pipes\PipeStream.cs" />
    <Compile Include="System\IO\Pipes\PipeTransmissionMode.cs" />
    <Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
             Link="Common\DisableRuntimeMarshalling.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeThreadHandle.cs"
             Link="Microsoft\Win32\SafeHandles\SafeThreadHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
             Link="Common\Interop\Windows\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CloseHandle.cs"
             Link="Common\Interop\Windows\Interop.CloseHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Errors.cs"
             Link="Common\Interop\Windows\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FormatMessage.cs"
             Link="Common\Interop\Windows\Interop.FormatMessage.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GenericOperations.cs"
             Link="Interop\Windows\Interop.GenericOperations.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SecurityOptions.cs"
             Link="Common\CoreLib\Interop\Windows\Interop.SecurityOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
             Link="Common\CoreLib\Interop\Windows\Interop.BOOL.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs"
             Link="Common\CoreLib\Interop\Windows\Interop.SECURITY_ATTRIBUTES.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.HandleOptions.cs"
             Link="Common\Interop\Windows\Interop.HandleOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.PipeOptions.cs"
             Link="Common\Interop\Windows\Interop.PipeOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FileOperations.cs"
             Link="Common\Interop\Windows\Interop.FileOperations.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FileTypes.cs"
             Link="Common\Interop\Windows\Interop.FileTypes.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetCurrentProcess.cs"
             Link="Common\Interop\Windows\Interop.GetCurrentProcess.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.DuplicateHandle_SafePipeHandle.cs"
             Link="Common\Interop\Windows\Interop.DuplicateHandle_SafePipeHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetFileType_SafeHandle.cs"
             Link="Common\Interop\Windows\Interop.GetFileType.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CreatePipe_SafePipeHandle.cs"
             Link="Common\Interop\Windows\Interop.CreatePipe_SafePipeHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.ConnectNamedPipe.cs"
             Link="Common\Interop\Windows\Interop.ConnectNamedPipe.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.WaitNamedPipe.cs"
             Link="Common\Interop\Windows\Interop.WaitNamedPipe.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetNamedPipeHandleState.cs"
             Link="Common\Interop\Windows\Interop.GetNamedPipeHandleState.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetNamedPipeInfo.cs"
             Link="Common\Interop\Windows\Interop.GetNamedPipeInfo.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SetNamedPipeHandleState.cs"
             Link="Common\Interop\Windows\Interop.SetNamedPipeHandleState.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CancelIoEx.cs"
             Link="Common\Interop\Windows\Interop.CancelIoEx.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FlushFileBuffers.cs"
             Link="Common\Interop\Windows\Interop.FlushFileBuffers.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs"
             Link="Common\Interop\Windows\Interop.ReadFile_IntPtr.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs"
             Link="Common\Interop\Windows\Interop.ReadFile_NativeOverlapped.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs"
             Link="Common\Interop\Windows\Interop.WriteFile_IntPtr.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs"
             Link="Common\Interop\Windows\Interop.WriteFile_NativeOverlapped.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.DisconnectNamedPipe.cs"
             Link="Common\Interop\Windows\Interop.DisconnectNamedPipe.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CreateNamedPipe.cs"
             Link="Common\Interop\Windows\Interop.CreateNamedPipe.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.MaxLengths.cs"
             Link="Common\Interop\Windows\Interop.MaxLengths.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RevertToSelf.cs"
             Link="Common\Interop\Windows\Interop.RevertToSelf.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ImpersonateNamedPipeClient.cs"
             Link="Common\Interop\Windows\Interop.ImpersonateNamedPipeClient.cs" />
    <Compile Include="$(CommonPath)System\IO\Win32Marshal.cs"
             Link="Common\CoreLib\System\IO\Win32Marshal.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CreateNamedPipeClient.cs"
             Link="Common\Interop\Windows\Interop.CreateNamedPipeClient.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.LoadLibraryEx_IntPtr.cs"
             Link="Common\Interop\Windows\Interop.LoadLibraryEx_IntPtr.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.OpenThread.cs"
         Link="Common\Interop\Windows\Interop.OpenThread.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CancelSynchronousIo.cs"
         Link="Common\Interop\Windows\Interop.CancelSynchronousIo.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetCurrentThreadId.cs"
         Link="Common\Interop\Windows\Interop.GetCurrentThreadId.cs" />
    <Compile Include="$(CommonPath)System\Threading\AsyncOverSyncWithIoCancellation.cs"
         Link="Common\System\Threading\AsyncOverSyncWithIoCancellation.cs" />
    <Compile Include="Microsoft\Win32\SafeHandles\SafePipeHandle.Windows.cs" />
    <Compile Include="System\IO\Pipes\AnonymousPipeServerStreamAcl.cs" />
    <Compile Include="System\IO\Pipes\AnonymousPipeServerStream.Windows.cs" />
    <Compile Include="System\IO\Pipes\NamedPipeServerStreamAcl.cs" />
    <Compile Include="System\IO\Pipes\NamedPipeClientStream.Windows.cs" />
    <Compile Include="System\IO\Pipes\NamedPipeServerStream.Windows.cs" />
    <Compile Include="System\IO\Pipes\NamedPipeServerStream.Win32.cs" />
    <Compile Include="System\IO\Pipes\PipeAccessRule.cs" />
    <Compile Include="System\IO\Pipes\PipeAuditRule.cs" />
    <Compile Include="System\IO\Pipes\PipesAclExtensions.cs" />
    <Compile Include="System\IO\Pipes\PipeSecurity.cs" />
    <Compile Include="System\IO\Pipes\PipeStream.ValueTaskSource.cs" />
    <Compile Include="System\IO\Pipes\PipeStream.Windows.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'unix'">
    <Compile Include="Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs" />
    <Compile Include="System\IO\Pipes\AnonymousPipeServerStream.Unix.cs" />
    <Compile Include="System\IO\Pipes\NamedPipeClientStream.Unix.cs" />
    <Compile Include="System\IO\Pipes\NamedPipeServerStream.Unix.cs" />
    <Compile Include="System\IO\Pipes\PipeStream.Unix.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
             Link="Common\Interop\Unix\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
             Link="Common\CoreLib\Interop\Unix\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.IOErrors.cs"
             Link="Common\CoreLib\Interop\Unix\Interop.IOErrors.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Close.cs"
             Link="Common\Interop\Unix\Interop.Close.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Fcntl.Pipe.cs"
             Link="Common\Interop\Unix\Interop.Fcntl.Pipe.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Fcntl.cs"
             Link="Common\Interop\Unix\Interop.Fcntl.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.FLock.cs"
             Link="Common\Interop\Unix\Interop.FLock.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetHostName.cs"
             Link="Common\Interop\Unix\Interop.GetHostName.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Open.cs"
             Link="Common\Interop\Unix\Interop.Open.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.OpenFlags.cs"
             Link="Common\Interop\Unix\Interop.OpenFlags.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Pipe.cs"
             Link="Common\Interop\Unix\Interop.Pipe.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetPwUid.cs"
             Link="Common\Interop\Unix\System.Native\Interop.GetPwUid.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Read.Pipe.cs"
             Link="Common\Interop\Unix\Interop.Read.Pipe.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Unlink.cs"
             Link="Common\Interop\Unix\Interop.Unlink.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Write.Pipe.cs"
             Link="Common\Interop\Unix\Interop.Write.Pipe.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Stat.cs"
             Link="Common\Interop\Unix\Interop.Stat.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Stat.Pipe.cs"
             Link="Common\Interop\Unix\Interop.Stat.Pipe.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetPeerID.cs"
             Link="Common\Interop\Unix\Interop.GetPeerID.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetEUid.cs"
             Link="Common\Interop\Unix\Interop.GetEUid.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.SetEUid.cs"
             Link="Common\Interop\Unix\Interop.SetEUid.cs" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="System.Collections" />
    <Reference Include="System.Memory" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.Runtime.InteropServices" />
    <Reference Include="System.Security.AccessControl" />
    <Reference Include="System.Security.Principal.Windows" />
    <Reference Include="System.Threading" />
    <Reference Include="System.Threading.Overlapped" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Reference Include="System.Collections.NonGeneric" />
    <Reference Include="System.Security.Claims" />
    <Reference Include="System.Threading.ThreadPool" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'unix'">
    <Reference Include="Microsoft.Win32.Primitives" />
    <Reference Include="System.Net.Primitives" />
    <Reference Include="System.Net.Sockets" />
  </ItemGroup>

</Project>
